package com.doradance.app.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.doradance.R;
import com.doradance.common.web.CommonWebviewFragment;
import com.pachong.android.baseuicomponent.activity.BaseActivity;

public class ActivityDetailActivity extends BaseActivity {
    private int id;
    public static Activity ActivityDetailActivity;
    private CommonWebviewFragment mWebviewFragment;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityDetailActivity=this;
        id = getIntent().getIntExtra("id", -1);
        hideToolbar();
        String mUrl ="http://h5.doradance.cn/#/activityDetail?id="+id;
        mWebviewFragment = CommonWebviewFragment.newInstance(mUrl);
        getSupportFragmentManager().beginTransaction().add(R.id.fl_activity_detail, mWebviewFragment).commit();
    }

    private void initToolsBar() {
        setTitle("活动");
        getCustomToolbar().addLeftImageButton(R.mipmap.back, new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                finish();
            }
        });
        getCustomToolbar().addRightImageButton(R.mipmap.icon_share, new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.activity_detail,null);
    }
    public static void start(Activity activity,int id){
        Intent intent = new Intent(activity, ActivityDetailActivity.class);
        intent.putExtra("id",id);
        activity.startActivity(intent);
    }
}
